<template>
  <div id="container"></div>
</template>

<script>
export default {
  name: "mapTest",
  methods: {
    mapInit() {
      var map = new BMapGL.Map("container"); // 创建Map实例
      map.centerAndZoom(new BMapGL.Point(116.404, 39.915), 10); // 初始化地图,设置中心点坐标和地图级别
      map.enableScrollWheelZoom(true); // 开启鼠标滚轮缩放
    },
  },
  mounted() {
    this.mapInit();
  },
};
</script>

<style>
#container {
  overflow: hidden;
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: "微软雅黑";
}
</style>
